import { Routes, Route } from "react-router-dom";
import Home from "@/pages/Home";
import StrengthTrainingDetail from "@/pages/StrengthTrainingDetail";
import AerobicExerciseGuide from "@/pages/AerobicExerciseGuide";
import YogaShapingGuide from "@/pages/YogaShapingGuide";
import NutritionGuide from "@/pages/NutritionGuide";
import ThreeMonthFitnessPlan from "@/pages/ThreeMonthFitnessPlan";
import PersonalizedFitnessPlan from "@/pages/PersonalizedFitnessPlan";
import PhilosophyPage from "@/pages/PhilosophyPage";
import FiveDaySplitTraining from "@/pages/FiveDaySplitTraining";
import DietPlan from "@/pages/DietPlan";
import FitnessKnowledgeShare from "@/pages/FitnessKnowledgeShare";
import { useState } from "react";
import { AuthContext } from '@/contexts/authContext';
import { Empty } from "@/components/Empty";
import FitnessKnowledgeDetail from "@/pages/FitnessKnowledgeDetail";

export default function App() {
  const [isAuthenticated, setIsAuthenticated] = useState(false);

  const logout = () => {
    setIsAuthenticated(false);
  };

  return (
    <AuthContext.Provider
      value={{ isAuthenticated, setIsAuthenticated, logout }}
    >
      <Routes>
        <Route path="/" element={<Home />} />
        <Route path="/categories" element={<FitnessKnowledgeShare />} />
        <Route path="/3month-plan" element={<ThreeMonthFitnessPlan />} />
        <Route path="/plans" element={<PersonalizedFitnessPlan />} />
          <Route path="/nutrition" element={<NutritionGuide />} />
          <Route path="/philosophy" element={<PhilosophyPage />} />
           <Route path="/five-day-split" element={<FiveDaySplitTraining />} />
           <Route path="/diet-plan" element={<DietPlan />} />
        <Route path="/other" element={<Empty />} />
        <Route path="/strength-training" element={<StrengthTrainingDetail />} />
        <Route path="/aerobic-exercise-guide" element={<AerobicExerciseGuide />} />
        <Route path="/personalized-fitness-plan" element={<PersonalizedFitnessPlan />} />
        <Route path="/yoga-shaping-guide" element={<YogaShapingGuide />} />
        <Route path="/knowledge/:id" element={<FitnessKnowledgeDetail />} />
      </Routes>
    </AuthContext.Provider>
  );
}

